<script src="/assets/js/simple-jekyll-search.min.js"></script>

<script type="module">
  import {SEARCH} from '/search.js'

  SimpleJekyllSearch({
    searchInput: document.getElementById('search-input'),
    resultsContainer: document.getElementById('results-container'),
    json: SEARCH,
    searchResultTemplate: '<li><a href="{url}">{title}</a><br /><span>{tags}</span><br/><span>{content}</span></li>',
    templateMiddleware: (prop, value, template) => {
      if (prop === 'content') {
        return value.substring(0, 50)
      }
    }
  })
</script>
